//
//  OrderMessageCell.m
//  CenturyCity
//
//  Created by beisheng03 on 2018/1/10.
//  Copyright © 2018年 beisheng. All rights reserved.
//

#import "OrderMessageCell.h"

@interface OrderMessageCell ()

@property (weak, nonatomic) IBOutlet UILabel *leftLabel;
@property (weak, nonatomic) IBOutlet UITextView *rightTextField;


@property (weak, nonatomic) IBOutlet UILabel *placholderLabel;

@end

@implementation OrderMessageCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.leftLabel.font = MYFONT(15);
    
    self.placholderLabel.font = MYFONT(15);
    
    self.placholderLabel.textColor = placeholderColor;
    
    self.rightTextField.font = MYFONT(15);
    
    self.rightTextField.scrollEnabled = NO;

    self.rightTextField.autocapitalizationType = UITextAutocapitalizationTypeNone;
    //    [self.textView setAutocapitalizationType:UITextAutocapitalizationTypeNone];
    // Initialization code
    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(textChange) name:UITextViewTextDidChangeNotification object:self.rightTextField];
    // Initialization code
}

- (void)setModel:(OrderSureModel *)model{
    _model = model;
    
    if (_model.leavemessage.length > 0) {
        self.rightTextField.text = _model.leavemessage;
    }
    
    
    
}



- (void)textChange{
    
    self.model.leavemessage = self.rightTextField.text;
    
    self.placholderLabel.hidden = self.rightTextField.hasText;
    
    [self.tableView beginUpdates];
    
    [self.tableView endUpdates];
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
